package com.hkd.cya;

public class PersonSingleton {
    private String id;
    private String name;
    private static PersonSingleton ins=null;

    public PersonSingleton() {
        this.id = "2101001";
        this.name ="张三";
        System.out.println("第一次办理身份证------");
        System.out.println("姓名是："+name);
        System.out.println("id是："+id);
    }
    public static PersonSingleton getlns(){
if (ins==null){
    ins=new PersonSingleton();
}else {
    System.out.println("------重新办理身份证，----"+ins.id+"已经被分配了");
}
return ins;
    }
}
